package com.yegs.jltqc.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Data
public class WorkFlow {

    public static final String STATUS_END = "审批结束";
    public static final String STATUS_ING = "审批中";

    public static final String RESULT_REJECT = "审批不通过";
    public static final String STATUS_SPEC = "特采";
    public static final String STATUS_RETURN = "退货";
    public static final String STATUS_PROCESS = "加工";

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private Long refId;

    private String userType;

    private String workName;

    private String status;

    /**
     * 总结果
     */
    private String result;

    private String remark;

    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date createTime;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    @OneToOne(targetEntity = QcProduce.class)
    @JoinColumn(name = "refId", referencedColumnName = "id",insertable=false, updatable=false)
    private QcProduce qcProduce;

    @OneToMany(targetEntity = WorkFlowResult.class)
    @JoinColumn(name = "refId", insertable=false, updatable=false)
    private List<WorkFlowResult> list;

}
